﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace dpdw.Structure.CompositePattern
{
    public abstract class MenuComponent
    {
        public virtual void Add(MenuComponent menuComponent)
        {

        }

        public virtual void Remove(MenuComponent menuComponent)
        {

        }

        public virtual MenuComponent GetChild(int i)
        {
            return null;
        }

        public virtual string GetName()
        {
            return null;
        }

        public virtual string GetDescription()
        {
            return null;
        }

        public virtual double GetPrice()
        {
            return 0;
        }

        /// <summary>
        /// 素食
        /// </summary>
        /// <returns></returns>
        public virtual bool IsVegetarian()
        {
            return true;
        }

        public virtual void Print()
        {
            // 用迭代器模式处理
        }
    }
}
